﻿@model Project_2._2.ViewModels.CarList_ViewModel
@{
    ViewBag.Title = "Cập Nhật Thông Tin Xe cho Thuê ";
    Layout = "~/Views/Shared/_UserLayoutPage2.cshtml";
    Project_2._2.Models.QuanLyThueXeEntities db = new Project_2._2.Models.QuanLyThueXeEntities();



}
<script src="~/Content/ckfinder/ckfinder.js"></script>
<script src="~/Script/jquery-1.3.2.min.js"></script>
<script src="~/Content/ckeditor_4.3.1_full/ckeditor/ckeditor.js"></script>

<script src="~/Script/Validate/jquery.validate.min.js"></script>
<script src="~/Script/Validate/jquery.validate.unobtrusive.min.js"></script>
<script src="~/Script/Validate/jquery.validate.min.js"></script>
<script src="~/Script/Validate/jquery.validate.unobtrusive.min.js"></script>
<link href="~/Content/Validate%20Javascript/validationEngine.jquery.css" rel="stylesheet" />
<script src="~/Script/Validate%20Javascript/jquery-1.8.2.min.js"></script>
<script src="~/Script/Validate%20Javascript/jquery.validationEngine.js"></script>
<script src="~/Script/Validate%20Javascript/jquery.validationEngine-vi.js"></script>

<script>
    jQuery(document).ready(function () {
        // binds form submission and fields to the validation engine
        jQuery("#form").validationEngine();
    });

</script>

<script type="text/javascript" lang="ja">

    document.getElementById("news").setAttribute("class", "activee")
</script>

<style type="text/css">
    .mail_lienhe {
        color: #676767;
    }

        .mail_lienhe:hover {
            color: #ff0000;
        }
</style>
<div style="width:748px; min-height:500px; height:auto; border:2px solid #cfcfcf; border-radius:5px; margin-top:10px">
    <div style="height:54px; width:748px; background:url('~/Images/UserDesign/bg_right.png') repeat-x; border-bottom:2px solid #cfcfcf;">
        <div style="width:105px; height:54px; float:left; margin-left:5px;">
            <img src="~/Images/UserDesign/car.png" />
        </div>
        <div style="width:638px; height:54px; float:right">
            <span style="font-weight:bold; color:#ffffff; font-family:Tahoma; font-size:14px; line-height:38px">Cập Nhật THÔNG TIN ĐẶT XE</span>
        </div>
    </div>


    @using (Html.BeginForm("UpdateXeKH", "Default", FormMethod.Post, new { id = "form", enctype = "multipart/form-data" }))
    {
        @Html.ValidationSummary(true)
        @Html.AntiForgeryToken()

        <table style=" line-height: 35px; color: #808080; font-weight: bold">
            <tr>
                <td style="padding-left:10px;padding-top : 20px"><label>Tên Xe</label><span style="color:red"> *</span></td>
                <td style="padding-top: 20px">
                    @Html.TextBoxFor(m => m.name, new { @class = "Textbox", style = @"width: 220px" })
                    <br />@Html.ValidationMessageFor(m => m.name)
                </td>

                <td style=" padding-top:20px"><label>Thương Hiệu Xe</label><span style="color:red"> *</span></td>
                <td style="padding-top: 20px">
                    @{

        List<SelectListItem> Listthuonghieu = new List<SelectListItem>();
        var Listth = from p in db.ThuongHieux select p;
        foreach (var item in Listth)
        {
            Listthuonghieu.Add(new SelectListItem { Text = item.TenThuongHieu, Value = Convert.ToString(item.ThuongHieuId) });
        }
                    }
                    @Html.DropDownListFor(m => m.ThuongHieuID, Listthuonghieu, new { @class = "select", @style = "width:230px" })
                </td>
            </tr>

            <tr>
                <td style="padding-left: 10px; padding-top: 10px"><label>Dòng Xe</label><span style="color:red"> *</span></td>
                <td>
                    @Html.TextBoxFor(m => m.DongXe, new { @class = "Textbox", style = @"width: 220px" })
                    <br />@Html.ValidationMessageFor(m => m.DongXe)
                </td>
                <td style="padding-top: 10px"><label>Phụ Trợ Quá KM</label><span style="color:red"> *</span></td>
                <td style="padding-top: 10px">
                    @Html.TextBoxFor(m => m.PhuTroKM, new { @class = "Textbox", style = @"width: 220px" })
                    <br />@Html.ValidationMessageFor(m => m.PhuTroKM)
                </td>
            </tr>
            <tr>
                <td style="padding-left: 10px; padding-top: 10px; "><label>Loại Xe</label><span style="color:red"> *</span></td>
                <td style="padding-top: 10px">
                    @{

        List<SelectListItem> ListLoaiXe = new List<SelectListItem>();
        var Listlx = from p in db.LoaiXes select p;
        foreach (var item in Listlx)
        {
            ListLoaiXe.Add(new SelectListItem { Text = item.TenLoaiXe, Value = Convert.ToString(item.LoaiXeId) });
        }
                    }
                    @Html.DropDownListFor(m => m.LoaiID, ListLoaiXe, new { @class = "select", @style = "width:230px" })
                </td>

                <td style="padding-top: 10px"><label>Sử Dụng Cuối Tuần</label><span style="color:red"> *</span></td>
                <td style="padding-top: 10px">
                    @Html.TextBoxFor(m => m.SuDungCuoiTuan, new { @class = "Textbox", style = @"width: 220px" })
                    <br /> @Html.ValidationMessageFor(m => m.SuDungCuoiTuan)
                </td>
            </tr>
            <tr>
                <td style="padding-left: 10px; padding-top: 10px"><label>Đời Xe</label><span style="color:red"> *</span></td>
                <td style="padding-top: 10px">
                    @Html.TextBoxFor(m => m.DoiXe, new { @class = "Textbox", style = @"width: 220px" })
                    <br />@Html.ValidationMessageFor(m => m.DoiXe)
                </td>

                <td style="padding-top: 10px"><label>Phụ Trợ Ngoài Giờ</label><span style="color:red"> *</span></td>
                <td style="padding-top: 10px">
                    @Html.TextBoxFor(m => m.PhuTroNgoaiGio, new { @class = "Textbox", style = @"width: 220px" })
                    <br />@Html.ValidationMessageFor(m => m.PhuTroNgoaiGio)
                </td>
            </tr>
            <tr>
                <td style="padding-left: 10px; padding-top: 10px"> <label>Dịch Vụ</label><span style="color:red"> *</span></td>
                <td style="padding-top: 10px">
                    @{

                        List<SelectListItem> ListServiec = new List<SelectListItem>();
                        var Listdv = from p in db.DichVuThueXes select p;
                        foreach (var item in Listdv)
                        {
                            ListServiec.Add(new SelectListItem { Text = item.TenDichVu, Value = Convert.ToString(item.DichVuId) });
                        }
                    }
                    @Html.DropDownListFor(m => m.dichvuID, ListServiec, new { @class = "select", @style = "width:230px" })
                </td>
                <td style=" padding-top: 10px"> <label>Màu Xe</label><span style="color:red"> *</span></td>
                <td style="padding-top: 10px">
                    @Html.TextBoxFor(m => m.Color, new { @class = "Textbox", style = @"width: 220px" })
                    <br />@Html.ValidationMessageFor(m => m.Color)
                </td>
            </tr>
            <tr>
                <td style="padding-left: 10px; width: 100px; padding-top: 10px"> <label>Trạng Thái</label><span style="color:red"> *</span></td>
                <td style="padding-top: 10px">
                    @{
                        List<SelectListItem> listtt = new List<SelectListItem>();
                        listtt.Add(new SelectListItem { Text = "Sẵn Sàng", Value = "Sẵn Sàng", Selected = true });
                        listtt.Add(new SelectListItem { Text = "Đang Bận", Value = "Đang Bận" });
                    }
                    @Html.DropDownListFor(m => m.TThai, listtt, new { @class = "select", @style = "width:230px" })
                </td>
                <td style=" padding-top: 10px"> <label>Giá Cho Thuê</label><span style="color:red"> *</span></td>
                <td style="padding-top: 10px">
                    @Html.TextBoxFor(m => m.Gia, new { @class = "Textbox", style = @"width: 220px" })
                    <br />@Html.ValidationMessageFor(m => m.Gia)
                </td>
            </tr>

            <tr>
                <td style="padding-left: 10px; width: 100px; padding-top: 10px"> <label>Hình Ảnh</label><span style="color:red"> *</span></td>
                <td style="padding-top: 10px">
                    <input type="file" id="file" name="uploadFile" />
                </td>
                <td style=" padding-top: 10px"> <label>Clip Quảng Cáo </label><span style="color:red"> *</span></td>
                <td style="padding-top: 10px">
                    @Html.TextBoxFor(m => m.Video, new { @class = "Textbox", style = @"width: 220px" })
                    <br />@Html.ValidationMessageFor(m => m.Video)
                </td>
            </tr>
            <tr>
                <td style="padding-left:10px;" colspan="4"> Chi Tiết</td>
            </tr>
            <tr>
                <td colspan="4">
                    @Html.TextAreaFor(m => m.ChiTiet)
                    @Html.ValidationMessageFor(m => m.ChiTiet)
                </td>
            </tr>
            <tr>
                <td class="align-right" style="padding-top:12px">@Html.LabelFor(m => m.captcha) <span style="color:red">  *  </span></td>
                <td style="padding-top:12px">
                    @Html.TextBoxFor(m => m.captcha, new { @class = "Textbox validate[required]", @style = "width:80px" })
                    <img id="Img3" alt="Captcha image" src="~/Captcha/Captcha" style=" margin-bottom:-10px; height:29px;border-radius:4px; " />
                    @Html.ValidationMessageFor(m => m.captcha)
                </td>
            </tr>
            <tr>
                <td style="text-align:center" colspan="4">
                    <input type="submit" value="Cập Nhât" class="Button" />
                </td>
            </tr>
        </table><br />
    }

</div>



<script language="javascript" type="text/javascript">

    $(function () {
        $("#chonanhbia").click(function () {
            var finder = new CKFinder();
            finder.selectActionFunction = function (fileUrl) {
                $("#anhbia").val(fileUrl);
            };
            finder.popup();
        });
    });
</script>


<script type="text/javascript">

    $(document).ready(function () {
        $("#form").submit(function (e) {

            $("#ChiTiet").val(CKEDITOR.instances["ChiTiet"].getData());
            $(this).submit();
        });
        CKEDITOR.replace('ChiTiet',
        {
            filebrowserBrowseUrl: 'Create.cshtml'
        });
    });
</script>



